$.ajax({
    url: '/users.do',
    method: 'GET',
    success: function (result) {
        if (result && result.length > 0) {
            for (var i = 0; i < result.length; i++) {
                var val = result[i];
                $(`<tr>
	<td>${val.id}</td>
	<td>${val.username}</td>
	<td>${val.phone}</td>
	<td>${val.state == 1? '正常':'冻结'}</td>
    <td>
                  <button class="am-btn am-btn-success resetPass">重置密码</button>
                  ${val.state == 1 ? '<button class="am-btn am-btn-danger remove">冻结</button>' : '<button class="am-btn am-btn-primary wwww">解冻</button>'}
                  </td>
</tr>`).appendTo('tbody');
            }
        }
    }
})


$(document).on('click', '.resetPass', function () {
    prompt('请输入新密码');
})



$(document).on('click','.remove',function(){
    confirm('确认要冻结吗？');
})

$(document).on('click','.wwww',function(){
    confirm('确认要冻结吗？');
})